<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="com.wlcorp.forcazamis.domain.storagein.StorageIn" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="com.wlcorp.forcazamis.domain.storagein.StorageInSample" %>

<%
	StorageIn storageIn = (StorageIn)request.getAttribute("storageIn");
%>
<html>
<head>
	<title>样品入库单打印</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-Control" content="no-cache"><meta http-equiv="Expires" content="0">
	<link href="${pageContext.request.contextPath}/css/print.css" rel=stylesheet>
	<style media="print">
	<!--
	.Noprint{display:none;}
	.PageNext{page-break-after:always;}
	-->
	</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class=Noprint>
  <tr>
      <td align="right"> 
        <input type="button" name="previewButton" value="打印预览" onClick="wb.execwb(7,1)">
        <input type="button" name="printButton" value=" 打  印 " onClick="window.print()">
        <input type="button" name="closeButton" value="关闭窗口" onClick="window.close()">
      </td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> 
  <td width="20%">&nbsp;</td>
  <td width="40%" align="center" class="bigtext" height="40"><b><font size="5">样品(入库)单 
    No.${storageIn.storageInId} </font></b></td>
  <td width="20%">&nbsp;</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  	<tr> 
	  <td width="50%"><b><span class="title_middle">入库人:</span></b><span class="title_middle">&nbsp;${storageIn.submiter.staffName}</span><span class="title_middle"><br>
	    <b>仓库名称</b><b>:</b>&nbsp;样品部<br>
	    </span> </td>
	  <td width="50%"><b><span class="title_middle">入库时间</span></b><b><span class="title_middle">:</span></b><span class="title_middle">&nbsp;${storageIn.inStorageDate}</span><span class="title_middle"><br>
	    <b>仓库管理员</b><b>:</b>&nbsp;</span></td>
	</tr>
	<tr> 
	  <td colspan="2"><b><span class="title_middle">备注</span></b><b><span class="title_middle"></span></b><b><span class="title_middle">:</span></b><span class="title_middle">&nbsp;${storageIn.memo}</span><span class="title_middle"><br>
	    </span></td>
	</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tbprint">
      <tr>
        <td class="tdprint" height="25" align="center">样品编号</td>
        <td class="tdprint" align="center">尺寸</td>
        <td class="tdprint" height="25" align="center">电镀色号</td>
        <td class="tdprint" align="center">颜色描述</td>
        <td class="tdprint" height="25" align="center">数量</td>
        <td class="tdprint" align="center">单价</td>
        <td class="tdprint" height="25" align="center">金额</td>
        <td class="tdprint" align="center">备注</td>
      </tr>
      <%
      	int totalCount = 0;
      	double totalPrice = 0;
      	if(null != storageIn.getStorageInSampleSet() && storageIn.getStorageInSampleSet().size() > 0){
      		for(Iterator iter = storageIn.getStorageInSampleSet().iterator();iter.hasNext();){
      			StorageInSample storageInSample = (StorageInSample)iter.next();
      			totalCount = totalCount + storageInSample.getInCount().intValue();
      			totalPrice = totalPrice + storageInSample.getTotalPrice().doubleValue();
      %>
      <tr id="<%=storageInSample.getId()%>">
     	<td class="tdprint" height="25"><%=storageInSample.getSubSample().getParentSample().getSampleCode()%></td>
        <td class="tdprint" height="25"><%=storageInSample.getSubSample().getSize()%></td>
        <td class="tdprint" height="25"><%=storageInSample.getSubSample().getPlateColor()%></td>
        <td class="tdprint" height="25"><%=storageInSample.getSubSample().getCcolorDesc()%></td>
        <td class="tdprint" height="25"><%=storageInSample.getInCount()%></td>
        <td class="tdprint" height="25"><%=storageInSample.getPrice()%></td>	
        <td class="tdprint" height="25"><%=storageInSample.getTotalPrice()%></td> 
        <td class="tdprint" height="25"><%=storageInSample.getMemo()%></td>	
	  </tr>
	  <%}}%>
	  <tr>
     	<td class="tdprint" height="25">合计</td>
        <td class="tdprint" height="25"></td>
        <td class="tdprint" height="25"></td>
        <td class="tdprint" height="25"></td>
        <td class="tdprint" height="25"><%=totalCount%></td>
        <td class="tdprint" height="25"></td>	
        <td class="tdprint" height="25"><%=totalPrice%></td> 
        <td class="tdprint" height="25"></td>	
	  </tr>
</table>
<OBJECT id=wb height=0 width=0 classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 name="wb"></OBJECT>

</body>
</html>
